//
//  BottomPopupView.h
//  Tunnel
//
//  Created by wbb on 2025/6/10.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


typedef void(^BottomPopupViewCompletion)(NSInteger selectedIndex, NSString *selectedItem);

@interface BottomPopupView : UIView

/**
 * 创建底部弹出选择器
 * @param title 标题文本
 * @param items 选择器的选项数组
 * @param selectedIndex 默认选中项的索引
 * @return 底部弹出框实例
 */
+ (instancetype)pickerPopupWithTitle:(NSString *)title
                               items:(NSArray<NSString *> *)items
                       selectedIndex:(NSInteger)selectedIndex;

/**
 * 显示弹出框
 * @param viewController 弹出框所在的视图控制器
 * @param animated 是否使用动画
 * @param completion 选择完成后的回调，返回选中项的索引和文本
 */
- (void)showInViewController:(UIViewController *)viewController
                    animated:(BOOL)animated
                  completion:(BottomPopupViewCompletion)completion;
@end
NS_ASSUME_NONNULL_END
